package com.bak;

import java.awt.*;

public class Expolode {
    public static final int WIDTH = ResourceManager.explodes[0].getWidth();
    public static final int HEIGHT = ResourceManager.explodes[0].getHeight();
    private int x;
    private int y;
    private TankFrame tankFrame;
    private boolean live = true;
    private int step = 0;

    public Expolode() {

    }

    public Expolode(int x, int y, TankFrame tankFrame) {
        this.x = x;
        this.y = y;
        this.tankFrame = tankFrame;
    }


    public void paint(Graphics g) {
        if (step >= ResourceManager.explodes.length) {
            step = 0;
            tankFrame.getExpolodeList().remove(this);
            return;
        }
        g.drawImage(ResourceManager.explodes[step++], x, y, null);
    }


    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }


    public boolean isLive() {
        return live;
    }

    public void setLive(boolean live) {
        this.live = live;
    }


}
